Player = function()
{
  this.so;
  window.player = this;
}
Player.prototype.write = function (htmlelement)
{
    this.so.write(htmlelement);
}
Player.prototype.configure = function (conf_)
{

  var conf = (conf_  instanceof Object)?conf_:{};
  var def = {
      playersrc: '/player/jw_mp3_player/mp3player.swf',
      width:'410',
      height:'20',
      src:'',
      frontcolor: '0x93C6D3',
      backcolor: '0x000000',
      backgroundcolor: '0x93C6D3',
      lightcolor: '0xffffff',
      autoscroll:false,
      showeq:true,
      enablejs:false,
      allowfullscreen:false,
      allowscriptaccess:true,
      screencolor: '0x336699',
      id:null
  
    };
    
    // fill in the missing user param with default values
    for (k in def)
      if ((typeof(conf[k]) != typeof(def[k])) && typeof(def[k]) != null) 	conf[k] = def[k];
  
    this.so = new SWFObject(conf['playersrc'],'mt_player',conf['width'], conf['height'], '7', conf['backgroundcolor']);
  
    this.so.addParam('allowfullscreen',(conf['allowfullscreen']?'true':'false'));
    this.so.addParam('allowscriptaccess',(conf['allowscriptaccess']?'true':'false'));
    this.so.addVariable('file',conf['src']);
    this.so.addVariable('height',conf['height']);
    this.so.addVariable('width',conf['width']);
    this.so.addVariable('frontcolor',conf['frontcolor']);
    this.so.addVariable('backcolor',conf['backcolor']);
    this.so.addVariable('lightcolor',conf['lightcolor']);
    this.so.addVariable('screencolor',conf['screencolor']);
    this.so.addVariable('autoscroll',(conf['autoscroll']?'true':'false'));
    this.so.addVariable('showeq',(conf['showeq']?'true':'false'));
    this.so.addVariable('enablejs',(conf['enablejs']?'true':'false'));
    if(conf['id']) this.so.addVariable('id',conf['id']);
  
   return this;
}
